using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Data.SqlClient;
using System.Data;

namespace Acms.SqlDal
{
    public class UserPostUploadVoteTotalDal : Base
    {
        public enum Fields
        {
        	PostId, 
		    UploadId,
		    Score, 
		    Total  
        }

        protected override void ReadRecord(Hashtable table, SqlDataReader reader)
        {
            GetReaderValue<int>(Fields.PostId, reader, table);
            GetReaderValue<int>(Fields.UploadId, reader, table);
            GetReaderValue<decimal>(Fields.Score, reader, table);
            GetReaderValue<int>(Fields.Total, reader, table);
        }

        public Hashtable[] GetAllByUploadId(int uploadId)
        {
            SqlCommand cmd = CreateCommand("GetAllByUploadId");
            AddInputParameter(cmd, "UploadId", uploadId, SqlDbType.Int);

            return base.ExecuteGetCollection(cmd);
        }
    }
}
